<div class="page-wrapper clearfix" id="pageDivider">
    <?php
        //1, get current page
        $page = $this->Paginator->current();

        //2, calculate prev page link
        if($this->Paginator->hasPrev() && isset($url)){
            if(preg_match("/[\x7f-\xff]/",$url)){
                echo '<li class="prev disabled"><a href="'.$url.'_'.($page-1).'.html">« 上一页</a></li>';
            } else if($url === 'hot' || $url === 'new'){
                echo '<li class="prev disabled"><a href="'.$url.'_'.($page-1).'.html">« 上一页</a></li>';
            } else {
                echo '<li class="prev disabled"><a href="'.$url.($page-1).'.html">« 上一页</a></li>';
            }
        }else if($this->Paginator->numbers()){
            echo $this->Paginator->prev('« 上一页');
        }

        //3, calculate numbers link
        if(isset($url)){
            if(preg_match("/[\x7f-\xff]/",$url)){
                $this->Paginator->setTemplates([
                    'number' => '<em><a href="'.$url.'_{{text}}.html">{{text}}</a></em>',
                ]);
            } else if($url === 'hot' || $url === 'new'){
                $this->Paginator->setTemplates([
                    'number' => '<em><a href="'.$url.'_{{text}}.html">{{text}}</a></em>',
                ]);
            } else {
                $this->Paginator->setTemplates([
                    'number' => '<em><a href="'.$url.'{{text}}.html">{{text}}</a></em>',
                ]);
            }
        }

        echo $this->Paginator->numbers();

        //4,calculate next page linke

        if($this->Paginator->hasNext() && isset($url)){
            if(preg_match("/[\x7f-\xff]/",$url)){
                echo '<li class="prev disabled"><a href="'.$url.'_'.($page+1).'.html">下一页 »</a></li>';
            } else if($url === 'hot' || $url === 'new'){
                echo '<li class="prev disabled"><a href="'.$url.'_'.($page+1).'.html">下一页 »</a></li>';
            } else {
                echo '<li class="prev disabled"><a href="'.$url.($page+1).'.html">下一页 »</a></li>';
            }
        } else if($this->Paginator->numbers()){
            echo $this->Paginator->next('下一页 »');
        }
    ?>
</div>
